Mega Code Archive

Categories
1) Android
2) ASP.Net
3) ASP.Net Tutorial
4) C
5) C Tutorial
6) C#
7) C# Book
8) C# by API
9) C# Tutorial
10) C++
11) C++ Tutorial
12) Delphi
13) Flash ActionScript
14) Flex
15) Java
16) Java Book
17) Java by API
18) Java Tutorial
19) JavaScript DHTML
20) JavaScript Reference
21) JavaScript Tutorial
22) MSOfficeExcel 2007 Tutorial
23) MSOfficePowerPoint 2007 Tutorial
24) MSOfficeWord 2007 Tutorial
25) MSSQL
26) MSSQL Tutorial
27) MySQL
28) MySQL Tutorial
29) Oracle PLSQL
30) Oracle PLSQL Tutorial
31) Perl
32) Php
33) PostgreSQL
34) Python
35) Python Tutorial
36) Ruby
37) Silverlight
38) VB.Net
39) VB.Net by API
40) VB.Net Tutorial
41) Visual C++ .NET
42) VisualBasic Script
43) XML
44) XML Tutorial
 
Python Tutorial
1) Buildin Function
2) Buildin Module
3) CGI Web
4) Class
5) Collections
6) Data Type
7) Database
8) Dictionary
9) File
10) Function
11) Introduction
12) List
13) Network
14) Operator
15) Regular Expressions
16) Statement
17) String
18) Thread
19) Tkinker
20) Tuple
21) Windows
22) Wxpython
23) XML
Class
1) __bases__ Class Attribute
2) __call__ Intercepts Calls
3) __del__ Is a Destructor
4) __del__() Destructor Method
5) __dict__ is a dictionary representing its attributes
6) __getattr__ and __setattr__ Catch Attribute References
7) __getitem__ and __iter__ Implement Iteration
8) __getitem__ Intercepts Index References
9) __getitem__ used in a for loop
10) __init__() is not invoked automatically when the subclass is instantiated
11) __nonzero__() overridden to return False
12) __radd__ Handles Right-Side Addition
13) __repr__ and __str__ Return String Representations
14) __repr__ method should return a string that could be used as executable code to re-create the object
15) __setitem__ used in a for loop
16) __str__ is tried first for user-friendly displays
17) __str__, __add__, __mul__,__nonzero__,__norm_cval,__cmp__
18) A list with an access counter
19) A setter
20) Add method to a class from outside
21) Alternative
22) An example of using a class data attribute (foo)
23) Any Number of Items Iterator
24) Attach attributes to the class by assigning names to it outside of the original class
25) Attribute Reference
26) Attributes are values associated with the object
27) Basic Customization
28) Built-in Type Attributes
29) Calling Superclass Constructors
30) Class Attributes More Persistent
31) Class Employee with a static method
32) Class Employee with class attribute count
33) Class Inheritance
34) Class Interface Techniques
35) Class that defines method __getattribute__ and __getattr__
36) Class Time with accessor methods
37) Class Time with default constructor
38) Class with private data members
39) Classes and Types
40) Classes Are Customized by Inheritance
41) Classes Can Intercept Python Operators
42) Common operator overloading methods
43) Constructor with default parameter
44) Constructors
45) Converting an iterator to a list using the list constructor
46) Creating a Class (Class Definition)
47) Creating a class hierarchy with an abstract base class
48) Creating and accessing object attributes
49) Creating Subclasses
50) Define and access Properties
51) Defining Class Methods with the def Statement
52) Definition and test function for class Cylinder
53) Definition of class Date
54) Demonstrates a basic class and object
55) Demonstrates creating and accessing object attributes
56) Demonstrates get and set methods and properties
57) Demonstrates private variables and methods
58) Deriving Standard Types
59) Determining Instance Attributes
60) Double Underscore __
61) Emulating Privacy for Instance Attributes
62) Function Interfaces and Callback-Based Code
63) Give the constructor some parameters to work with
64) Hasattr(), getattr(), setattr(), delattr()
65) Here is our modified class inspired by the recipe
66) Declare Classes
67) If you want the base class __init__() invoked
68) Inherit from two base classes
69) Instance Attributes versus Class Attributes
70) Instance Objects Are Concrete Items
71) Instantiation
72) Intermediate Customization
73) Isinstance() determines if an object is an instance of a given class
74) Iterators
75) Let us make our example more useful by giving P some attributes
76) Make a new iterator object for each new iteration
77) Metaclass Example
78) Methods calling
79) Methods in class
80) Modifying Class Attributes
81) Mutable Type Example
82) No __nonzero__()
83) Numeric Customization
84) Object interaction
85) Objects in the class namespace can be accessed directly using the module name and dot syntax
86) OOP and Inheritance
87) Operator Overloading
88) Overriding base-class methods
89) Overriding Methods through Inheritance
90) Overriding the Constructor
91) Private Variables
92) Python properties (or attributes) are dynamic
93) Rectangle class
94) Related Modules and Documentation
95) Representation of phone number in USA format
96) Self __class__ __name__ represents the name of the class
97) Set properties when constructed
98) Setattr and getattr
99) Simple Attribute Lookup Example
100) Simple Customization
101) Simple definition of class Time
102) Special Class Attributes
103) Special Instance Attributes
104) Specializing Inherited Methods
105) Specify any necessary parameters to the __init__() function
106) Static Methods and Class Methods
107) Stick in a documentation string for your attribute
108) The Iterator Protocol
109) The property Function
110) The property() built-in function can take up to four arguments
111) Throwing Methods Around
112) Use Caution When Accessing Class Attribute with Instance
113) Use self to reference properties
114) User-Defined Iterators
115) Using Decorators
116) Using super
117) When using the keyword super, and that is why the super() built-in function was eventually added to Python, so you could do the corr
118) Wrapping Standard Types